package com.itheima.tlias84.po;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
public class UpdateEmpParam {
     private  int id;
    @NotNull(message = "用户名不能为空")
    @Length(min = 2, max = 20 , message = "用户名长度为[2,20]")
    private String username;
    @NotNull(message = "姓名不能为空")
    @Length(min = 2, max = 20 , message = "姓名长度为[2,20]")
    private String name;

    private int gender;
    @Length(min = 11 , message = "手机号长度必须是11位")
    @Pattern(regexp = "^1[3-9]\\d{9}$",message = "手机号格式错误")
    private String phone;

    private Integer job;

    private Integer salary;

    private String image;
//    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate entryDate;

    private Integer deptId;
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

}
